package com.myjava.thread;

/**
 * @auther: tao
 * @date: 2018/9/21 14:40
 * @description: 线程的优先级
 */
public class ThreadPriorityDemo5 {
    public static void main(String args[]) {
        Thread t1 = new Thread(new MyThread5(), "线程A");  // 实例化线程对象
        Thread t2 = new Thread(new MyThread5(), "线程B");  // 实例化线程对象
        Thread t3 = new Thread(new MyThread5(), "线程C");  // 实例化线程对象
        t1.setPriority(Thread.MIN_PRIORITY);   // 优先级最低
        t2.setPriority(Thread.MAX_PRIORITY);   // 优先级最高
        t3.setPriority(Thread.NORM_PRIORITY);  // 优先级最中等
        t1.start();    // 启动线程
        t2.start();    // 启动线程
        t3.start();    // 启动线程
    }
}
